import requests
import json

headers = {
    'Host':'www.yueshushu.top',
    'Referer': 'https://www.yueshushu.top/Stock/',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
}

print("Get 请求有 参数")
params3 = {"code": "002812", "type":1}
get3 = requests.get("https://www.yueshushu.top/StockApi/stockCrawler/getStockInfo",params= params3,
                    headers = headers)
content = get3.content.decode()
print(f'content: {content}')
json3 = json.loads(content)
print(json3)


print("post 请求 json 参数")
data2 = {"pageNum":1, "pageSize":15}
post2 = requests.post("https://www.yueshushu.top/StockApi/jobInfo/list",json= data2,
                      headers = headers)
content = get3.content.decode()
print(f'content: {content}')
json2 = json.loads(content)
print(json2)
